package cwiczenia.cwiczenia9.zad6;

public class Main {
    public static void main(String[] args) {
        bezRoznic();
        zRoznicami();
    }

    private static void bezRoznic() {
        System.out.println("***************************************************");
        System.out.println("Bez róznic");
        System.out.println("Petla while: ");

        int i = 1;
        while (i<=5) {
            System.out.println(i);
            i++;
        }

        System.out.println();
        System.out.println("Petla do-while: ");

        int j = 1;
        do {
            System.out.println(j);
            j++;
        } while (j<=5);
    }

    private static void zRoznicami() {
        System.out.println("\n***************************************************");
        System.out.println("Z róznicami");                  // gdy warunek nie jest spelniony
        System.out.println("Petla while: ");

        int i = 1;
        while (i>5) {
            System.out.println(i);
            i++;
        }

        System.out.println();
        System.out.println("Petla do-while: ");

        int j = 1;
        do {
            System.out.println(j);
            j++;
        } while (j>5);
    }
}
